//
//  YCDynamicNavigationBar.h
//  YCDynamicNavigationBarDemo
//
//  Created by Jim on 2018/8/13.
//  Copyright © 2018年 youcash. All rights reserved.
//

#import <UIKit/UIKit.h>

@class YCDynamicNavigationBar;

@protocol YCDynamicNavigationBarDelegate <NSObject>

@optional
- (void)dynamicBar:(YCDynamicNavigationBar *)bar didChangeHeight:(CGFloat)height;

@end

@interface YCDynamicNavigationBar : UIView

@property (nonatomic, strong, readonly) UILabel *titleLb;
@property (nonatomic, strong) UIFont *originalTitleFont; // 默认: [UIFont boldSystemFontOfSize:17]

@property (nonatomic, strong, readonly) UIButton *leftBtn;
@property (nonatomic, strong, readonly) UIButton *rightBtn;

@property (nonatomic, weak) id<YCDynamicNavigationBarDelegate> delegate;

@property (nonatomic, assign) CGFloat threshold; // 偏移多少才改变 (默认0, 设置为"CGFLOAT_MAX"可以关闭bar的缩放)
@property (nonatomic,assign) CGFloat resetHeight; // 上滑一定距离才恢复原状（默认40)

@property (nonatomic, assign) BOOL hideBottomLine; // 是否隐藏底部分割线 默认不隐藏

/// 绑定scroll view 控制bar的缩放
- (void)bindScrollView:(UIScrollView *)scrollView;

- (void)addLeftTitle:(NSString *)title image:(UIImage *)image target:(id)target action:(SEL)action;
- (void)addRightTitle:(NSString *)title image:(UIImage *)image target:(id)target action:(SEL)action;

@end
